package org.dreamfly.netshop.entity;

import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * Member entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Member")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Member implements java.io.Serializable {

    // Fields
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String name;
    private boolean sex;
    private String password;
    @Column(name = "truename")
    private String trueName;
    private String questions;
    private String answers;
    private String phone;
    private String mobile;
    private String emails;
    private String city;
    private String address;
    @Column(name = "postcode")
    private String postCode;
    @Column(name = "advancepayment")
    private Double advancePayment;
    @Column(name = "loaddate")
    private Date loadDate;

    @OneToMany(targetEntity = OrderInfo.class, mappedBy = "member", fetch = FetchType.LAZY)
    private Set<OrderInfo> orderInfos = new LinkedHashSet<OrderInfo>(0);

    @OneToMany(targetEntity = ShopCart.class, mappedBy = "member", fetch = FetchType.LAZY)
    private Set<ShopCart> shopCarts = new LinkedHashSet<ShopCart>(0);

    @OneToMany(targetEntity = ShopCart.class, mappedBy = "member", fetch = FetchType.LAZY)
    private Set<Address> addresses = new LinkedHashSet<Address>(0);

    // Constructors

    /** default constructor */
    public Member() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean getSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTrueName() {
        return trueName;
    }

    public void setTrueName(String trueName) {
        this.trueName = trueName;
    }

    public String getQuestions() {
        return questions;
    }

    public void setQuestions(String questions) {
        this.questions = questions;
    }

    public String getAnswers() {
        return answers;
    }

    public void setAnswers(String answers) {
        this.answers = answers;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getEmails() {
        return emails;
    }

    public void setEmails(String emails) {
        this.emails = emails;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPostCode() {
        return postCode;
    }

    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }

    public Double getAdvancePayment() {
        return advancePayment;
    }

    public void setAdvancePayment(Double advancePayment) {
        this.advancePayment = advancePayment;
    }

    public Date getLoadDate() {
        return loadDate;
    }

    public void setLoadDate(Date loadDate) {
        this.loadDate = loadDate;
    }

    public Set<OrderInfo> getOrderInfos() {
        return orderInfos;
    }

    public void setOrderInfos(Set<OrderInfo> orderInfos) {
        this.orderInfos = orderInfos;
    }

    public Set<ShopCart> getShopCarts() {
        return shopCarts;
    }

    public void setShopCarts(Set<ShopCart> shopCarts) {
        this.shopCarts = shopCarts;
    }

    public Set<Address> getAddresses() {
        return addresses;
    }

    public void setAddresses(Set<Address> addresses) {
        this.addresses = addresses;
    }

}